<?php

namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-ActivityGoodsValidate
 * Class ActivityGoodsValidate
 * @package app\validate
 */
class AgencyGoodsValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require|number',
        'agency_id|代理商id' => 'require',
        'goods_id|商品id' => 'require',
        'goods_storage|入库数量' => 'egt:0'
    ];

    //验证场景-更新
    public function sceneUpdate()
    {
        return $this->only(['id', 'activity_id']);
    }

    /**
     * 修改库存场景
     * @return AgencyGoodsValidate
     */
    public function sceneChange()
    {
        return $this->only(['id', 'storage', 'change']);
    }
}
